/*
    赛车模拟器v1.0
    使用方法请看README.md
    gitee链接 https://gitee.com/ZDZX-T/Joystick-racing
*/
#include "f.h"

void setup(){
    initButtons();

    if(DEBUG_MOD==0)
    {
        initJoystick();
    }
    else
    {
        Serial.begin(9600);
    }
}

void loop(){
    if(DEBUG_MOD==0)
    {
        readSteeringAndSet();
        readSpeedAndSet();
        readBrakeAndSet();
        readButtonsAndSet();
        sendState();
        delay(SCAN_SPEED);
    }
    else
    {
        DEBUG_FUN();
    }
}
